package com.eastfair.auth.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.auth.enumeration.UserAccountStatusEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 用户表
 * </p>
 *
 * @author ligang
 * @since 2022-03-18
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("c_user_account")
@ApiModel(value = "UserAccount", description = "用户表")
@AllArgsConstructor
public class UserAccount extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    @Size(max = 255, message = "头像长度不能超过255")
    @TableField(value = "head_img", condition = LIKE)
    @Excel(name = "头像")
    private String headImg;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    @Size(max = 255, message = "昵称长度不能超过255")
    @TableField(value = "nick_name", condition = LIKE)
    @Excel(name = "昵称")
    private String nickName;

    /**
     * 登录名
     */
    @ApiModelProperty(value = "登录名")
    @Size(max = 64, message = "登录名长度不能超过64")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "登录名")
    private String name;

    /**
     * 手机区号
     */
    @ApiModelProperty(value = "手机区号")
    @Size(max = 64, message = "手机区号长度不能超过64")
    @TableField(value = "mobile_country_code", condition = LIKE)
    @Excel(name = "手机区号")
    private String mobileCountryCode;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @Size(max = 16, message = "手机号长度不能超过16")
    @TableField(value = "mobile", condition = LIKE)
    @Excel(name = "手机号")
    private String mobile;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @Size(max = 256, message = "密码长度不能超过256")
    @TableField(value = "password", condition = LIKE)
    @Excel(name = "密码")
    private String password;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    @Size(max = 64, message = "邮箱长度不能超过64")
    @TableField(value = "email", condition = LIKE)
    @Excel(name = "邮箱")
    private String email;

    /**
     * 状态 #{normal:正常;wait_init:待初始化;forbidden:禁用;waiting:待审核;refuse:拒绝;delete:已删除}
     */
    @ApiModelProperty(value = "状态 #{normal:正常;wait_init:待初始化;forbidden:禁用;waiting:待审核;refuse:拒绝;delete:已删除}")
    @TableField(value = "status")
    @Excel(name = "状态 #{normal:正常;wait_init:待初始化;forbidden:禁用;waiting:待审核;refuse:拒绝;delete:已删除}", replace = {"正常_NORMAL", "待初始化_WAIT_INIT", "禁用_FORBIDDEN", "待审核_WAITING", "拒绝_REFUSE", "已删除_DELETE",  "_null"})
    private UserAccountStatusEnum status;

    /**
     * 公司id
     */
    @ApiModelProperty(value = "公司id")
    @TableField(value = "company_id")
    @Excel(name = "公司id")
    private Long companyId;

    /**
     * 展商id
     */
    @ApiModelProperty(value = "展商id")
    @TableField(value = "exhibitor_id")
    @Excel(name = "展商id")
    private Long exhibitorId;

    /**
     * 观众id
     */
    @ApiModelProperty(value = "观众id")
    @TableField(value = "visitor_id")
    @Excel(name = "观众id")
    private Long visitorId;

    /**
     * 是否是观众 1是 0否
     */
    @ApiModelProperty(value = "是否是观众 1是 0否")
    @TableField(value = "is_visitor")
    @Excel(name = "是否是观众 1是 0否")
    private Integer isVisitor;

    /**
     * 是否是主办 1是 0否
     */
    @ApiModelProperty(value = "是否是主办 1是 0否")
    @TableField(value = "is_sponsor")
    @Excel(name = "是否是主办 1是 0否")
    private Integer isSponsor;

    /**
     * 是否是员工 1是 0否
     */
    @ApiModelProperty(value = "是否是员工 1是 0否")
    @TableField(value = "is_employee")
    @Excel(name = "是否是员工 1是 0否")
    private Integer isEmployee;

    /**
     * 是否是展商 1是 0否
     */
    @ApiModelProperty(value = "是否是展商 1是 0否")
    @TableField(value = "is_actor")
    @Excel(name = "是否是展商 1是 0否")
    private Integer isActor;

    /**
     * 是否是游客 1是 0否
     */
    @ApiModelProperty(value = "是否是游客 1是 0否")
    @TableField(value = "is_tourist")
    @Excel(name = "是否是游客 1是 0否")
    private Integer isTourist;

    /**
     * 是否完成完善信息：1是；0否
     */
    @ApiModelProperty(value = "是否完成完善信息：1是；0否")
    @TableField(value = "is_complete_info")
    @Excel(name = "是否完成完善信息：1是；0否")
    private Integer isCompleteInfo;

    /**
     * 是否完成问卷：1是；0否
     */
    @ApiModelProperty(value = "是否完成问卷：1是；0否")
    @TableField(value = "is_complete_question")
    @Excel(name = "是否完成问卷：1是；0否")
    private Integer isCompleteQuestion;

    /**
     * 是否启用 1是 0否
     */
    @ApiModelProperty(value = "是否启用 1是 0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用 1是 0否")
    private Integer isEnabled;

    /**
     * 是否删除 1是 0否
     */
    @ApiModelProperty(value = "是否删除 1是 0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除 1是 0否")
    private Integer isDeleted;


    @Builder
    public UserAccount(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, String headImg, String nickName, String name, String mobileCountryCode, 
                    String mobile, String password, String email, UserAccountStatusEnum status, Long companyId, Long exhibitorId, 
                    Long visitorId, Integer isVisitor, Integer isSponsor, Integer isEmployee, Integer isActor, Integer isTourist, 
                    Integer isCompleteInfo, Integer isCompleteQuestion, Integer isEnabled, Integer isDeleted) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.headImg = headImg;
        this.nickName = nickName;
        this.name = name;
        this.mobileCountryCode = mobileCountryCode;
        this.mobile = mobile;
        this.password = password;
        this.email = email;
        this.status = status;
        this.companyId = companyId;
        this.exhibitorId = exhibitorId;
        this.visitorId = visitorId;
        this.isVisitor = isVisitor;
        this.isSponsor = isSponsor;
        this.isEmployee = isEmployee;
        this.isActor = isActor;
        this.isTourist = isTourist;
        this.isCompleteInfo = isCompleteInfo;
        this.isCompleteQuestion = isCompleteQuestion;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
    }

}
